<!-- 日期时间选择器 -->
<template>
    <div>
        <el-config-provider :locale="zhCn">
            <el-date-picker v-model="value" type="datetime" placeholder="选择开放时间" format="YYYY/MM/DD HH:mm:ss"
                :disabled-date="disabledDate"  value-format="YYYY-MM-DD HH:mm:ss"
                @change="change" />
        </el-config-provider>
    </div>
</template>
   
<script lang="ts" setup>
import { defineEmits } from 'vue'
import zhCn from "element-plus/lib/locale/lang/zh-cn";
import { ref } from "vue";
const value = ref();
const emit = defineEmits(['change'])
const disabledDate = (time: Date) => {
    return time.getTime() < Date.now() - 86400000
}
const change = () => {
    emit('change', value.value)
}
</script>